#encoding:utf-8


print('请依次输入一元二次方程的三个参数a，b，c :')

a = float(input('a:'))
b = float(input('b:'))
c = float(input('c:'))
print('a =',a,'\nb =',b,'\nc =',c)
print("一元二次方程为：{}x² + {}x + {:.0f} = 0".format(" " if a==1 else a ," " if b==1 else b,c))

delta = b*b - 4*a*c
x1 = (-b+delta**0.5)/(2*a)
x2 = (-b-delta**0.5)/(2*a)
# print(delta)

if delta == 0:
        print("方程有两个相同的解,x=",-b/(2*a))
elif delta < 0:
        print("原方程无实根。")
else:
        print("方程有两个根分别为x1={:.3f},x2={:.3f}。".format(x1,x2))